<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      @keyframes ColorChange {
        0% {
          outline: 1px solid lightgreen;
        }

        50% {
          outline: 1px solid green;
        }

        100% {
          outline: 1px solid lightgreen;
        }
      }

      svg {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate3d(-50%, -50%, 0);
        outline: 1px solid red;
        animation: ColorChange 500ms ease infinite;
      }

      line,
      polyline,
      rect {
        stroke-linecap: round;
        stroke-linejoin: round;
      }
    </style>
  </head>

  <body>
    <svg width="600"
         height="600"
         xmlns="http://www.w3.org/2000/svg"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         preserveAspectRatio="xMinYMin meet"
         stroke-linecap="round"
         stroke-linejoin="round"
         viewBox="0 0 600 600">


      <!-- 顺时针方向的路径 -->
      <path d="M 0 0, 60 0, 60 60, 0 60 Z
               M 15 15, 45 15, 45 45, 15 45Z"
            fill-rule="nonzero"
            style="fill: rgba(0,255,0,0.1);" />
      <!-- 外部路径为顺时针方向，内部路径为逆时针方向 -->
      <path d="M 0 0, 60 0, 60 60, 0 60 Z
               M 15 15, 15 45, 45 45, 45 15Z"
            fill-rule="evenodd"
            style="fill: rgba(255,0,0,0.1);" />

      <!-- 设置路径相互覆盖的时候的填充规则，比如圆环或者矩形环，内层图形是否填充 -->

    </svg>

    <script>
      const ele = document.querySelector("#xxx");
      let n = 0;
      function Renderer() {
        n++;
        if (n >= 360) n = 0;
        window.requestAnimationFrame(Renderer);
      }
      // Renderer();
    </script>
  </body>

</html>
